package vn.edu.saigontech.ncms.web.receipt;

import vn.edu.saigontech.ncms.util.Checker;
import vn.edu.saigontech.ncms.web.AbstractValidator;

@SuppressWarnings("serial")
public class ValidateReceiptDailyReportAction extends AbstractValidator {

	private String date;

	@Override
	public String check() {
		if(Checker.isEmpty(this.date)) {
			this.sendKeyError("validator.required", "date");
		}
		if(!Checker.isDate(this.date, this.i18n("format.date"))) {
			this.sendKeyError("validator.mask", "date", "format.date");
		}
		return this.toSuccess();
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}
}
